#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    int n;
    cin >> n;

    vector<int> a(n + 1);
    vector<int> b(n + 1);

    // 输入能量消耗和补给
    for (int i = 0; i <= n; ++i) {
        cin >> a[i];
    }
    for (int i = 1; i <= n; ++i) {
        cin >> b[i];
    }

    // 计算前缀和
    vector<int> prefix_a(n + 2, 0);
    vector<int> prefix_b(n + 2, 0);
    for (int i = 1; i <= n + 1; ++i) {
        prefix_a[i] = prefix_a[i - 1] + a[i - 1];
        prefix_b[i] = prefix_b[i - 1] + b[i - 1];
    }

    // 计算后缀和
    vector<int> suffix_a(n + 2, 0);
    vector<int> suffix_b(n + 2, 0);
    for (int i = n + 1; i >= 1; --i) {
        suffix_a[i] = suffix_a[i + 1] + a[i];
        suffix_b[i] = suffix_b[i + 1] + b[i];
    }

    // 计算每个区域发生意外时的最小初始能量
    vector<int> result(n + 1);
    for (int i = 1; i <= n; ++i) {
        int energy_needed = max(
            prefix_a[i] - prefix_b[i] + a[i] + b[i],  // 考虑区域 i 的特殊情况
            suffix_a[i] - suffix_b[i]                // 考虑后续的总能量需求
        );
        result[i] = energy_needed;
    }

    // 输出结果
    for (int i = 1; i <= n; ++i) {
        cout << result[i] << (i < n ? " " : "");
    }
    cout << endl;

    return 0;
}